home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Drawing / GraphicsDeviceObject.h < prev    next >
Text File  |  1997-06-28  |  2KB  |  60 lines

  1. // GraphicsDeviceObject.h
  2.  
  3. #ifndef GraphicsDeviceObject_h
  4. #define GraphicsDeviceObject_h
  5.  
  6. #ifndef Rectangle_h
  7. #include "Rectangle.h"
  8. #endif
  9. #ifndef __PALETTES__
  10. #include <Palettes.h>
  11. #endif
  12.  
  13. class GraphicsDeviceObject
  14.   {
  15.     private:
  16.         GDHandle device;
  17.         
  18.     public:
  19.         GraphicsDeviceObject( GDHandle theDevice )
  20.           : device( theDevice )
  21.           {
  22.             Assert( device != 0 );
  23.             Assert( *device != 0 );
  24.           }
  25.         
  26.         operator GDHandle() const                                { return device; }
  27.         GDHandle Device() const                                    { return device; }
  28.         
  29.         int16 Driver() const                                        { return (*device)->gdRefNum; }
  30.         
  31.         Rectangle Bounds() const                                { return (*device)->gdRect; }
  32.         
  33.         bool InColor() const                                        { return TestDeviceAttribute( device, gdDevType ); }
  34.         bool HasBlockTransfer() const                            { return TestDeviceAttribute( device, burstDevice ); }
  35.         bool Needs32BitMode() const                            { return TestDeviceAttribute( device, ext32Device ); }
  36.         bool InitializedFromRam() const                        { return TestDeviceAttribute( device, ramInit ); }
  37.         bool IsMainScreen() const                                { return TestDeviceAttribute( device, mainScreen ); }
  38.         bool AllFromResources() const                            { return TestDeviceAttribute( device, allInit ); }
  39.         bool IsScreen() const                                    { return TestDeviceAttribute( device, screenDevice ); }
  40.         bool WithoutDriver() const                                { return TestDeviceAttribute( device, noDriver ); }
  41.         bool ScreenActive() const                                { return TestDeviceAttribute( device, screenActive ); }
  42.         
  43.         bool HasDepth( uint16 depth, bool inColor ) const
  44.             { return ::HasDepth( device, depth, gdDevType, inColor ); }
  45.         
  46.         void SetDepth( uint16 depth, bool inColor ) const
  47.             { ::SetDepth( device, depth, gdDevType, inColor ); }
  48.         
  49.         static GDHandle First()                                    { return GetDeviceList(); }
  50.         GDHandle Next() const                                    { return GetNextDevice( device ); }
  51.  
  52.         static GDHandle Current()                                { return GetGDevice(); }
  53.         static GDHandle Main()                                    { return GetMainDevice(); }
  54.         static GDHandle Deepest( const Rectangle& r )    { return GetMaxDevice( &r ); }
  55.         
  56.         static GDHandle Nearest( const Rectangle& );
  57.   };
  58.  
  59. #endif
  60.